package com.shiloop.flashlight;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

/**
 * Created by skiloop on 2014/9/4.
 */
public abstract class AbstractFlashView extends LinearLayout implements Flashlight.FlashlightListener {
    private Button mControlButton;

    public AbstractFlashView(Context context) {
        super(context);
        inflateView(context);
    }

    public AbstractFlashView(Context context, AttributeSet attrs) {
        super(context, attrs);
        inflateView(context);
    }

    public AbstractFlashView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        inflateView(context);
    }

    public Button getControlButton() {
        return mControlButton;
    }

    public void setControlButton(Button button) {
        mControlButton = button;
    }
    @Override
    public abstract void onFlashlightStatusChange(boolean isFlashLightOn);

    protected abstract void inflateView(Context context);
}
